*** Settings ***
Library           FakerLibrary    zh-CN
Library           AutoItLibrary
Library           SeleniumLibrary
Library           String
Resource          ../费用报销/通用费用报销页面元素.txt
Resource          ../../采购管理/采购目录.txt
Resource          ../../采购管理/采购品目.txt
Resource          ../../常用变量.txt
Resource          ../../基本配置.txt
Resource          ../../浏览器变量.txt
Resource          ../../常用变量.txt
Resource          ../申请-事前/事前申请页面元素.txt
Resource          ../申请-事前/因公出差页面元素.txt
Resource          ../申请-事前/事前申请页面元素.txt
Resource          ../申请-事前/事前申请总单据-事前申请.txt
Resource          借款申请页面元素.txt
Resource          ../费用报销/组织会议报销页面元素.txt
Resource          ../申请-事前/组织会议申请页面元素.txt
Resource          ../申请-事前/组织培训页面元素.txt
Resource          ../申请-事前/出国申请页面元素.txt
Resource          ../申请-事前/公务用车页面元素.txt
Resource          往来款申请页面元素.txt

*** Test Cases ***
往来款申请添加成功
    [Setup]    login
    log    往来款添加
    goto    ${contacts_payment_add}
    sleep    3
    ${payment_id}    往来款申请获取申请编号
    ${payment_contacts_amount}    设置两位随机数
    设置往来款金额    ${payment_contacts_amount}
    设置往来款申请类型-借款
    Comment    ${applyReason}    设置申请理由-根据时间格式定制
    ${applyReason}    Sentences
    申请理由    ${applyReason}
    设置往来款-保存
    sleep    3
    组织会议报销添加成功断言    ${payment_id}
    [Teardown]    close

往来款申请添加成功-退款
    [Setup]    login
    log    往来款添加
    goto    ${contacts_payment_add}
    sleep    3
    ${payment_id}    往来款申请获取申请编号
    ${payment_contacts_amount}    设置两位随机数
    设置往来款金额    ${payment_contacts_amount}
    设置往来款申请类型-退款
    ${applyReason}    Sentences
    申请理由    ${applyReason}
    设置往来款-保存
    sleep    3
    组织会议报销添加成功断言    ${payment_id}
    [Teardown]    close

往来款申请添加成功-工会经费
    [Setup]    login
    log    往来款添加
    goto    ${contacts_payment_add}
    sleep    3
    ${payment_id}    往来款申请获取申请编号
    ${payment_contacts_amount}    设置两位随机数
    设置往来款金额    ${payment_contacts_amount}
    ${applyReason}    Sentences
    申请理由    ${applyReason}
    设置往来款申请类型-工会经费
    设置往来款-保存
    sleep    3
    组织会议报销添加成功断言    ${payment_id}
    [Teardown]    close

往来款申请添加成功-党团费
    [Setup]    login
    log    往来款添加
    goto    ${contacts_payment_add}
    sleep    3
    ${payment_id}    往来款申请获取申请编号
    ${payment_contacts_amount}    设置两位随机数
    设置往来款金额    ${payment_contacts_amount}
    设置往来款申请类型-党团费
    ${applyReason}    Sentences
    申请理由    ${applyReason}
    设置往来款-保存
    sleep    3
    组织会议报销添加成功断言    ${payment_id}
    [Teardown]    close

往来款申请添加成功-转拨费
    [Setup]    login
    log    往来款添加
    goto    ${contacts_payment_add}
    sleep    3
    ${payment_id}    往来款申请获取申请编号
    ${payment_contacts_amount}    设置两位随机数
    设置往来款金额    ${payment_contacts_amount}
    设置往来款申请类型-转拨费
    ${applyReason}    Sentences
    申请理由    ${applyReason}
    设置往来款-保存
    sleep    3
    组织会议报销添加成功断言    ${payment_id}
    [Teardown]    close

往来款申请添加成功-应交费
    [Setup]    login
    log    往来款添加
    goto    ${contacts_payment_add}
    sleep    3
    ${payment_id}    往来款申请获取申请编号
    ${payment_contacts_amount}    设置两位随机数
    设置往来款金额    ${payment_contacts_amount}
    设置往来款申请类型-应交费
    ${applyReason}    Sentences
    申请理由    ${applyReason}
    设置往来款-保存
    sleep    3
    组织会议报销添加成功断言    ${payment_id}
    [Teardown]    close

往来款申请提交成功-应交费
    [Setup]    login
    log    往来款添加
    goto    ${contacts_payment_add}
    sleep    3
    ${payment_id}    往来款申请获取申请编号
    ${payment_contacts_amount}    设置两位随机数
    设置往来款金额    ${payment_contacts_amount}
    设置往来款申请类型-应交费
    ${applyReason}    Sentences
    申请理由    ${applyReason}
    设置往来款-提交
    sleep    3
    组织会议报销添加成功断言    ${payment_id}
    [Teardown]    close

往来款申请审核成功-应交费
    [Setup]    login
    log    往来款添加
    goto    ${contacts_payment_add}
    sleep    3
    ${payment_id}    往来款申请获取申请编号
    ${payment_contacts_amount}    设置两位随机数
    设置往来款金额    ${payment_contacts_amount}
    设置往来款申请类型-应交费
    ${applyReason}    Sentences
    申请理由    ${applyReason}
    设置往来款-提交
    sleep    3
    close browser
    log    第二步：审核添加的往来费申请
    login-审核流程    cyadmin_cj001    123456
    goto    ${contacts_payment_list}
    log    默认添加了关于[差率费]的项目，此处会自动关联
    sleep    6
    审核流程01
    sleep    3
    组织会议报销添加成功断言    ${payment_id}
    [Teardown]    close

往来款申请修改成功
    [Setup]    login
    log    往来款添加
    goto    ${contacts_payment_add}
    sleep    3
    ${payment_id}    往来款申请获取申请编号
    ${payment_contacts_amount}    设置两位随机数
    设置往来款金额    ${payment_contacts_amount}
    设置往来款申请类型-借款
    ${applyReason}    Sentences
    申请理由    ${applyReason}
    设置往来款-保存
    sleep    3
    公务接待点击修改按钮
    sleep    3
    ${payment_contacts_amount}    设置两位随机数
    设置往来款金额    ${payment_contacts_amount}
    设置往来款-保存
    sleep    5
    组织会议报销添加成功断言    ${payment_id}
    [Teardown]    close

往来款申请-确认删除
    [Setup]    login
    log    往来款添加
    goto    ${contacts_payment_add}
    sleep    3
    ${payment_id}    往来款申请获取申请编号
    ${payment_contacts_amount}    设置两位随机数
    设置往来款金额    ${payment_contacts_amount}
    设置往来款申请类型-借款
    ${applyReason}    Sentences
    申请理由    ${applyReason}
    设置往来款-保存
    sleep    3
    公务接待点击删除按钮
    sleep    3
    因公出差点击删除按钮-确认删除
    sleep    5
    组织会议报销添加成功断言-不存在名称    ${payment_id}
    [Teardown]    close

往来款申请-中断删除
    [Setup]    login
    log    往来款添加
    goto    ${contacts_payment_add}
    sleep    3
    ${payment_id}    往来款申请获取申请编号
    ${payment_contacts_amount}    设置两位随机数
    设置往来款金额    ${payment_contacts_amount}
    设置往来款申请类型-借款
    ${applyReason}    Sentences
    申请理由    ${applyReason}
    设置往来款-保存
    sleep    3
    公务接待点击删除按钮
    sleep    3
    因公出差点击删除按钮-中断删除操作
    sleep    5
    组织会议报销添加成功断言    ${payment_id}
    [Teardown]    close

测试faker
    ${test001}    name
    ${test002}    Sentences
    ${test003}    sentences
    ${test004}    ssn
    log    ${test001}
    log    ${test002}
    log    ${test003}
    log    ${test004}
